package com.puge.eduservice.controller;


import com.puge.commonutils.R;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.*;

/**
 * @author by sun
 * @date 2021/6/9.21:49
 */
@RestController
@RequestMapping("/eduservice/user")
@CrossOrigin
@Api(description = "登录和信息")//设置接口文档名称
//这个注释用来解决跨域问题
public class EduLoginController {

//    login
    @PostMapping("login")
    public R login(){
        return R.ok().data("token","admin");//返回token值
    }


//     info
    @GetMapping("info")//返回roles对象内包含name，avatar.
    public R info(){
        return R.ok().data("roles","[admin]").data("name","admin").data("avatar","https://image.baidu.com/search/detail?ct=503316480&z=undefined&tn=baiduimagedetail&ipn=d&word=%E5%8A%A8%E5%9B%BE&step_word=&ie=utf-8&in=&cl=2&lm=-1&st=undefined&hd=undefined&latest=undefined&copyright=undefined&cs=1055223764,2582940138&os=2046925843,3977049213&simid=0,0&pn=7&rn=1&di=172480&ln=1653&fr=&fmq=1623247462466_R&fm=&ic=undefined&s=undefined&se=&sme=&tab=0&width=undefined&height=undefined&face=undefined&is=0,0&istype=0&ist=&jit=&bdtype=0&spn=0&pi=0&gsm=0&hs=2&objurl=https%3A%2F%2Fgimg2.baidu.com%2Fimage_search%2Fsrc%3Dhttp%253A%252F%252F5b0988e595225.cdn.sohucs.com%252Fq_70%252Cc_zoom%252Cw_640%252Fimages%252F20180116%252Ffe3f076e36ff4d18a950164bc2700f6b.gif%26refer%3Dhttp%253A%252F%252F5b0988e595225.cdn.sohucs.com%26app%3D2002%26size%3Df9999%2C10000%26q%3Da80%26n%3D0%26g%3D0n%26fmt%3Djpeg%3Fsec%3D1625839463%26t%3D821ab7f0501f6b4121e1263ea0d81e12&rpstart=0&rpnum=0&adpicid=0&nojc=undefined");
    }
}
